{literal}
<style type="text/css">
    .pres {
        font-family: Times New Roman, serif;
        font-size: 12pt;        
    }
    .pres_header {      
        text-align: center;
        text-transform: uppercase;               
        font-size: 18pt;
        font-weight: bold;
        margin: 5px 0 5px 0;        
    }
    .pres_patient_row {
        height: 25px;
        line-height: 25px;
        text-align: left;   
    }
    
    .pres_label {
        float: left;
    }
    
    .pres_value {
        float: left;
        border-bottom: 1px dotted #000;
    }
</style>
{/literal}

<div id="maincontainer2" class="pres" style="width: 510px; margin: 0 0 0 10px;" align="center">
    <div class='pageHeader' style="width: 330px; float: left; text-align: center;">
        <span>{$hospitalInfo.name}</span>		
    	<span>{$hospitalInfo.address}</span>    	
    	<span>{$hospitalInfo.tel}</span>  
    </div>
    
    <div style="text-align: right;float: right; margin-right: 5px;">
        <span style="text-align: center; font-weight: bold;">Patient's ID: </span>
        <span style="text-align: center; font-weight: bold; font-size: 1.1em;">{$patientObj->get('patient_code')}</span>
    </div>    

	<div style="clear: both;"></div>
    
    <div class='pres_header'>
        Medical Prescription
    </div>
    
    
    <div class="pres_patient_row">
        <div class="pres_label" style="width: 140px;">Patient's FullName:</div>
        <div class="pres_value" style="width: 210px; font-weight: bold; text-transform: uppercase;">{$person->getName()}</div>
        
        <div class="pres_label" style="width: 50px;">Age:</div>
        <div class="pres_value" style="width: 30px; font-weight: bold; text-align: center;">{$person->getAge()}</div>
        <div class="pres_value" style="width: 60px; font-weight: bold; text-align: center;">
            {if $person->getGender()=="male" } Male {elseif $person->getGender()=="female"} Female {/if}
        </div>      
    </div>
    <div style="clear: both;"></div>
    
    <div class="pres_patient_row">
        <div class="pres_label" style="width: 200px;">Health insurance card number:</div>
        <div class="pres_value" style="width: 150px;">&nbsp;</div>
        <div class="pres_label" style="width: 50px;">Tel:</div>
        <div class="pres_value" style="width: 90px; text-align: center;">{$person->getPhoneNumber()} &nbsp;</div>
    </div>
    <div style="clear: both;"></div>    
    <div class="pres_patient_row">
        <div class="pres_label" style="width: 60px;">Address:</div>
        <div class="pres_value" style="width: 430px;">{$person->getAddress()}</div>
    </div>
    <div style="clear: both;"></div>
    
    <div class="pres_patient_row">
        <div class="pres_label" style="width: 90px; font-weight: bold; text-decoration: underline;">Diagnostic:</div>
        <div class="pres_value" style="width: 400px; font-weight: bold;">{$prescription.diagnosis|nl2br}&nbsp;</div>                                                  
    </div>
            
    <div style="clear: both;"></div>
    
    <div style="height: 300px; text-align: left; margin-top: 10px;">
        {assign var="i" value=1}
        <table cellspacing='0' cellpadding='0' style="width: 470px;">
                {foreach from=$presItem item=item}
                {if !empty($item.medicine_name)}
                    <tr>
                        <td valign='top' width='20px' style='text-align: left; padding-top: 7px; padding-bottom: 0px;'><span style='font-weight: bold; font-size: 1.1em'>{$i++}) </span></td>
                        <td valign='top' width='300px' style='text-align: left; padding-left: 5px; padding-top: 7px; padding-bottom: 0px; border-bottom: 1px dotted #000;'>
                            <span style='font-weight: bold; font-size: 1.1em'>
                              {$item.medicine_name|capitalize_first}
                            </span>
                        </td>
                        <td valign='top' width="180px" style='text-align: right; padding-top: 7px; padding-bottom: 0px; border: none; border-bottom: 1px dotted #000;'>
                            <span style='font-size: 1.1em; font-weight: bold;text-transform: lowercase;'>{$item.quantity_num} {$item.quantity_title_text}(s)</span>
                        </td>            
                    </tr>
                    
                    {if $item.usage_title == $usageKneadingConst}
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="2" style='text-align: left; padding-top: 4px; padding-bottom: 1px; border: none;'>
                            <span>                
                            Everyday uses {$item.usage_num} times, each time gently massage - brush your gum - your teeth after brushing your teeth                
                            </span>
                        </td>
                    </tr>           
                    {elseif $item.usage_title == $usageGargleConst}
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="2" style='text-align: left; padding-top: 4px; padding-bottom: 1px; border: none;'>
                            <span>                
                            Everyday uses {$item.usage_num} times, each time rinse your mouth carefully after brushing your teeth                
                            </span>
                        </td>
                    </tr>
                    {else}
                        <tr>
                            <td>&nbsp;</td>
                            <td colspan="2" style='text-align: left; padding-top: 4px; padding-bottom: 1px; border: none;'>
                                <span>                
                                Everyday <span style="text-transform: lowercase;">{$item.usage_title_text} {$item.usage_num} times, each time {$item.dosage} {$item.dosage_title_text}(s), use in {$item.time} days - before, after each meal</span>                
                                </span>
                            </td>
                        </tr>
                    {/if}
                    
                    {if $item.note != ''}
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="2" style='text-align: left; border: none; padding-top: 4px; padding-bottom: 1px;'>
                            <span>{$item.note|capitalize_first}</span>
                        </td>
                    </tr>
                    {/if}
                
                {/if}
                {/foreach}
        </table>
    </div>
    
    <div style="width: 65%; float: left;">
        <div class="pres_label" style="width: 70px; text-decoration: underline; font-weight: bold; text-align: left;">Advice:</div>
        <div class="pres_label" style="width: 325px; text-align: left;">{$prescription.note|nl2br}</div>
        <div style="clear: both;"></div> <br />
        <div class="pres_label" style="width: 100px; text-decoration: underline; font-weight: bold; text-align: left;">App. date:</div> 
        <div class="pres_label">{$prescription.re_examine}</div>
    </div>
            
    <div style="width: 35%; text-align: center; float: left;">
        <div style="width: 100%; text-align: center;">{$prescription.date_formatted}</div>      
        <div style="width: 100%; text-align: center; height: 100px;"><span style="text-transform: uppercase;">Doctor</span></div>                
    </div>
    <div style="clear: both;"></div>
    <div style="width: 100%; text-align: right;">Doctor's Fullname: &nbsp;&nbsp;
    	<span style="text-transform: uppercase;border-bottom: 1px dotted #000;">{$prescription.doctor_name}</span>
    </div>    
    <div class="pres_patient_row" style="margin-top: 5px;">
        <div class="pres_label" style="width: 350px;">Father / Mother's fullname of patient under 72 months old</div>
        <div class="pres_value" style="width: 160px;;">&nbsp;</div>
        <div style="clear: both;"></div>                    
    </div>
    <div class="pres_patient_row" style="width: 100%; margin-top: 20px;">
        <div class="pres_label" style="border-top: 1px solid #000; font-style: italic; width: 100%;">* Please bring this prescription with you when you come here next time</div>
    </div>
</div>
